package com.example.homework4;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity2<textView> extends AppCompatActivity {

    private Button button4;
    private Button button5;
    private Button button6;
    private TextView textView1;
    private TextView textView2;
    private TextView textView3;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);



        Intent intent1 = getIntent();
        String inputName =intent1.getStringExtra("com.example.homework4.textView1");
        textView1 = findViewById(R.id.textView);
        textView1.setText(inputName);

        Intent intent2 = getIntent();
        String inputName2 =intent2.getStringExtra("com.example.homework4.textView2");
        textView2 = findViewById(R.id.textView5);
        textView2.setText(inputName2);

        Intent intent3 = getIntent();
        String inputName3 =intent3.getStringExtra("com.example.homework4.textView3");
        textView3 = findViewById(R.id.textView7);
        textView3.setText(inputName3);

        button4=findViewById(R.id.button4);
        button5=findViewById(R.id.button5);
        button6=findViewById(R.id.button6);

        button4.setOnClickListener(this::conversion4);
        button5.setOnClickListener(this::conversion5);
        button6.setOnClickListener(this::conversion6);
    }

    private void conversion4(View view) {
        Intent intent4 = getPackageManager().getLaunchIntentForPackage("com.tencent.mm");
        startActivity(intent4);
    }

    private void conversion5(View view) {
        Intent intent5 = getPackageManager().getLaunchIntentForPackage("tv.danmaku.bili");
        startActivity(intent5);
    }
    private void conversion6(View view) {
        Intent intent6 = getPackageManager().getLaunchIntentForPackage("com.tencent.qqlive");
        startActivity(intent6);
    }
}